<template>
  <el-form
    :model="dynamicValidateForm"
    ref="dynamicValidateForm"
    label-width="600px"
    class="demo-dynamic"
  >
    <el-form-item>
      <span class="reg-s">{{$t('reg.register')}}</span>
    </el-form-item>
    <el-form-item class="reg.detail" Extrasmall>{{$t('reg.rel')}}</el-form-item>
    <el-form-item
      prop="email"
      label=" 邮箱"
      :placeholder="$t('loin.email')"
      :rules="[
      { required: true, message: '请输入邮箱地址', trigger: 'blur' },
      { type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
    ]"
    >
      <el-input v-model="dynamicValidateForm.email" class="buttonEmail">
        <span class="buttonEmail"></span>
      </el-input>
    </el-form-item>

    <el-form-item>
      <el-button type="primary" size="small" @click="handleTab(2)" class="reg-submit">
      <!-- <span class="regSubmit">{{$t('reg.submit')}}</span> -->
      <!-- <div> -->
        <router-link to="./regSuccess" class="regSubmit" tag="span">{{$t('reg.submit')}}</router-link>

      </el-button>
      <!-- <div class="reg-submit" type="primary" size="small"> -->
      <!-- </div> -->
    </el-form-item>
    <el-form-item>
      <div>
        {{$t('reg.login')}}
        <router-link to="/login" tag="a">{{$t('reg.logins')}}</router-link>
      </div>
    </el-form-item>
  </el-form>
</template>
<script>
import { mapGetters } from "vuex";
import website from "@/config/website";

export default {
  name:"register",
  data() {
    return {
      email:'',
      dynamicValidateForm: {
        domains: [
          {
            value: ""
          }
        ],
        email: ""
      }
    };
  },
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate(valid => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },

    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
    removeDomain(item) {
      var index = this.dynamicValidateForm.domains.indexOf(item);
      if (index !== -1) {
        this.dynamicValidateForm.domains.splice(index, 1);
      }
    },
    addDomain() {
      this.dynamicValidateForm.domains.push({
        value: "",
        key: Date.now()
      });
    }
  }
};
</script>
<style lang="scss" scoped>
el-form {
  // width: 80%;
  margin-bottom: 10px;
  display: flex;
  padding: 50px;
  position: relative;
}
.el-form-item__label {
  text-align: right;
  float: left;
  font-size: 14px;
  color: #606266;
  line-height: 188px;
  padding: 0 12px 0 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
.el-form-item__content {
  line-height: 40px;
  position: relative;
  font-size: 14px;
  top: 78px;
  margin: -4px;
}
.reg.detail {
  left: 20px;
  text-align: center;
}
.reg-submit {
  margin-bottom: 19px;
}
.el-button--small,
.el-button--small.is-round {
  padding: 14px 10px;
}
.reg-s {
  font-weight: bold;
  font-size: 20px;
  margin-left: 100px;
}
.buttonEmail {
  width: 48%;
}
.el-input__inner {
  -webkit-appearance: none;
  background-color: #fff;
  background-image: none;
  border-radius: 4px;
  border: 1px solid #dcdfe6;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #606266;
  display: inline-block;
  font-size: inherit;
  height: 40px;
  line-height: 40px;
  outline: 0;
  padding: 0 15px;
  -webkit-transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  width: 91%;
}
.reg-submit {
  width: 320px;
}
a {
  color: #049ec4;
  font-size: 12px;
}
</style>
